#ifndef APPLICATION_H
#define APPLICATION_H

#include <QtCore/QCoreApplication>
#include <QtCore/QSharedMemory>
#include <QtCore/QBuffer>
#include <QtCore/QTimer>
#include <LogiLcd.h>

#include "AudioSwitcher.h"

#define LOGI_LCD_MONO_MAX_LINE  (0x00000003)
#define LOGI_LCD_COLOR_MAX_LINE (0x00000006)

#define SHARED_MEMORY_MESSAGE		"{F7F53089-FCD9-4AC1-B336-3D935D92484C}"

class LcdAudioSwitcherApplication : public QCoreApplication
{
	Q_OBJECT

public:
	LcdAudioSwitcherApplication(int argc, char *argv[], QString title);
	~LcdAudioSwitcherApplication();
	void shutdown();
	int exitCode;

	static QSharedMemory sharedMem;	
	static bool loadIntoSharedMem(QString message);
	static QString loadFromSharedMem();

private:
	AudioSwitcher *as;
	LogiLcd *lcd;
	int firstLine;
	int firstLineColor;
	QTimer *timer;

	void nextAudio(ERole role);

	private slots:
		void updateScreen();
		void buttonPressed(int button);
		void timeout();
};

#endif // APPLICATION_H
